package com.vim.modules.web.service;

import com.vim.common.utils.IdGen;
import com.vim.common.base.CrudServiceImpl;
import com.vim.modules.web.model.CmsContent;
import com.vim.modules.web.dao.CmsContentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;

@Service
public class CmsContentService extends CrudServiceImpl<CmsContent> {

    @Resource
    private CmsContentMapper cmsContentMapper;

    @Autowired
    public CmsContentService(CmsContentMapper mapper) {
        super(mapper);
    }

    @Override
    public int save(CmsContent entity) {
        entity.setContentId(IdGen.uuid());
        entity.setCreateTime(new Date());
        return super.save(entity);
    }
}

